package tds.model1.version2;

import org.apache.commons.lang3.StringUtils;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName Operate
 * @Description TODO(操作符的枚举)
 * @author tds
 * @Date 2019年1月3日 下午1:39:11
 * @version 1.0.0
 */
@Getter
@AllArgsConstructor
public enum Operate {
	ADD(0, "+"),
	SUB(1, "-"),
	MUL(2, "*"),
	DIV(3, "/");
	private int code;
	private String operation;
	
	public static Operate valueOperationOf(String operation){
		for(Operate operate : values()){
			if(StringUtils.equals(operate.getOperation(), operation)){
				return operate;
			}
		}
		return null;
	}
}
